import Mock from "mockjs"; //导入mockjs

//使用Mock下面提供的mock方法进行需要模拟数据的封装
//参数1，是需要拦截的完整请求地址，参数2，是请求方式，参数3，是请求的模拟数据
const loginMock = Mock.mock("http://localhost:8080/user/login", "post", {
  code: 200,
  msg: "登录成功！",
  data: {
    user: {
      nickName: "yhj",
      department: "开发部",
    },
    token: "领导",
  }, //模拟的请求数据
});

const userInfoMock = Mock.mock("http://localhost:8080/user/info", "get", {
  code: 200,
  msg: "获取成功！",
  data: {
    userInfo: {
      nickName: "yhj",
      department: "开发部",
    },
  }, //模拟的请求数据
});

const getRoutes = Mock.mock("http://localhost:8080/menu/routes", "get", {
  code: 200,
  msg: "获取成功！",
  data: [
    {
      id: 1,
      pid: 0,
      name: "apiV1SystemMonitor1",
      component: "Layout",
      path: "/home",
      meta: {
        icon: "HomeFilled",
        title: "首页",
        showMenu: true,
      },
    },
    // {
    //   id: 1,
    //   pid: 0,
    //   name: "apiV1SystemMonitor1",
    //   component: "Layout",
    //   path: "/dashboard",
    //   meta: {
    //     icon: "HomeFilled",
    //     title: "首页",
    //     showMenu: true,
    //   },
    //   children: [
    //     {
    //       id: 11,
    //       pid: 1,
    //       name: "Dashboard",
    //       component: "/dashboard/index",
    //       path: "",
    //       meta: {
    //         showMenu: true,
    //         title: "dashboard",
    //         icon: "homepage",
    //       },
    //       children: [],
    //     },
    //   ]
    // },
    {
      id: 2,
      pid: 0,
      name: "systemManage",
      component: "Layout",
      path: "/dashbaoard",
      meta: {
        icon: "HomeFilled",
        title: "系统管理",
        showMenu: true,
      },
      children: [
        {
          id: 21,
          pid: 2,
          name: "apiV1SystemMonitorServer5",
          component: "/dashbaoard/index",
          path: "/system/monitor/server",
          meta: {
            icon: "",
            title: "服务监控",
            showMenu: true,
          },
          children: [],
        },
        {
          id: 22,
          pid: 2,
          name: "apiV1SystemLoginLogList6",
          component: "/dashbaoard/index",
          path: "/system/monitor/loginLog",
          meta: {
            icon: "",
            title: "登录日志",
            showMenu: true,
          },
          children: [],
        },
      ],
    },
  ], //模拟的请求数据
});

//导出
export default { loginMock, userInfoMock, getRoutes };
